home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / util / simulare.sit / Simula 4.07 Reference / card_32446.txt < prev    next >
Text File  |  1989-05-02  |  2KB  |  103 lines

  1. -- card: 32446 from stack: in.07 Reference
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13647
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0002
  11. -- rect: left=346 top=49 right=162 bottom=496
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 2 (field)
  23. -- low flags: 00
  24. -- high flags: 0002
  25. -- rect: left=346 top=165 right=289 bottom=496
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 0
  29. -- font id: 3
  30. -- text size: 9
  31. -- style flags: 0
  32. -- line height: 12
  33. -- part name: 
  34.  
  35.  
  36. -- part 3 (button)
  37. -- low flags: 00
  38. -- high flags: A004
  39. -- rect: left=294 top=291 right=313 bottom=378
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Continue
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   go to card id 32887
  51. end mouseUp
  52.  
  53.  
  54.  
  55.  
  56. -- part contents for background part 2
  57. ----- text -----
  58. Types - Text variables cont.
  59.  
  60. -- part contents for background part 1
  61. ----- text -----
  62. The attributes of a text variable can be accessed 
  63. with a number of operations:
  64.  
  65.          The POS indicator:
  66. T.LENGTH returns the number of characters in T, 
  67.                   =0 for Notext.
  68. T.SETPOS(n); will set the POS indicator to N, 
  69.                   or Lenght+1 if N>Length.
  70. T.POS returns the Pos indicator.
  71. T.MORE returns true if T.POS<=T.LENGTH.
  72.  
  73.             Access individual characters:
  74. T.GETCHAR returns the character at Pos 
  75.                     and increments Pos.
  76. T.PUTCHAR deposits a character at Pos 
  77.                     and increments Pos.
  78.  
  79.  
  80. -- part contents for card part 1
  81. ----- text -----
  82. ! Exercise 1;
  83. Text t1,t2; 
  84. t2:-copy(t1);
  85. ! could be code as;
  86.          t2:-blanks(t1.length);
  87.          t1.setpos(1);
  88.          while t1.more do
  89.             t2.putchar(t1.getchar);
  90.          t2.setpos(1);
  91.  
  92. -- part contents for card part 2
  93. ----- text -----
  94. ! Exercise 2;
  95. Text t1,t2; 
  96. t2:=t1;   
  97. ! could be coded as;
  98.       t1.setpos(1); t2.setpos(1);
  99.       while t1.more do
  100.          t2.putchar(t1.getchar);
  101.       while t2.more do
  102.         t2.putchar(' ');
  103.       t2.setpos(1);